<%@include file="header.jsp"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<div id="page-wrapper">
	<div class="row">
		<div class="col-lg-12">
			<h1 class="page-header">Thông tin sách</h1>
		</div>
		<!-- /.col-lg-12 -->
	</div>
	<c:url value="/book/saveorupdate" var="theAction"/>
	<form:form commandName="book" style="width: 50%;" action="${theAction}" method="POST">
		<label>Tên sách</label>
		<div class="form-group input-group">
			<span class="input-group-addon">Required</span>
			<form:input class="form-control" type="text" placeholder="Ví dụ: Dế mèn phưu lưu ký" path="bookName"></form:input>
		</div>
		
		<label>Số lượng hiện tại</label>
		<div class="form-group input-group">
			<span class="input-group-addon">Required</span>
			<form:input class="form-control" placeholder="Ví dụ: 10"
				type="text" path="bookQuantity"></form:input>
				<form:input type="hidden" path="bookId"></form:input>
		</div>
		
		<label>Giá </label>
		<div class="form-group input-group">
			<span class="input-group-addon">Required</span>
			<form:input class="form-control" placeholder="Ví dụ: 200000" type="text"
				path="bookPrice"></form:input>
			<span class="input-group-addon">.VND</span>
		</div>
		
		<label>Tác giả </label>
		<div class="form-group input-group">
			<span class="input-group-addon">Required</span>
			<form:select path="author.authorId" class="form-control">
				<c:forEach items="${authorList}" var="emp">
				<form:option value="${emp.authorId}" id="${emp.authorId}">${emp.authorName}</form:option>
				</c:forEach>
			</form:select>
		</div>
		
		<label>Ngôn ngữ </label>
		<div class="form-group input-group">
			<span class="input-group-addon">Required</span>
			<form:select path="language.languageId" class="form-control">
				<c:forEach items="${languageList}" var="emp">
				<form:option value="${emp.languageId}" id="${emp.languageId}">${emp.languageName}</form:option>
				</c:forEach>
			</form:select>
		</div>
		
		<label>Thể loại</label>
		<div class="form-group input-group">
			<span class="input-group-addon">Required</span>
			<form:select path="category.categoryId" class="form-control">
				<c:forEach items="${categoryList}" var="emp">
				<form:option value="${emp.categoryId}" id="${emp.categoryId}">${emp.categoryName}</form:option>
				</c:forEach>
			</form:select>
		</div>
		
		<button type="submit" class="btn btn-warning">Lưu lại</button>
		<a href="<c:url value="/customer"/>"> <span
			class="btn btn-info ">Quay lại danh sách </span>
		</a>
	</form:form>
</div>
<!-- /#page-wrapper -->
<!-- /#wrapper -->
<%@include file="footer.jsp"%>